def jia (num):
    a = []
    for j in range(0,num):
        x=int(input())
        a.append(x)
    sum = 0
    for i in a:
        sum = sum + i
    return sum

def jian (x,y):

    return x-y

def chen (x):
    a= []
    sum = 1
    for j in range (0,x):
        b=int(input())
        a.append(b)
    for i in a :
        sum = sum*i
    return  sum

def chu (x,y):
        return  x/y

while True:
    menu = {1:"加",2:"减",3:"乘",4:"除",5:"exit"}
    print(menu)
    n = int(input("输入实现的编号："))
    if n == 1:
        num = int(input("请输入要相加数字的个数:"))
        print(jia(num))

    elif n == 2:
        num1 = int(input("请输入被减数："))
        num2 = int(input("请输入减数:"))
        print(jian(num1,num2))
    elif n == 3:
        num3 = int(input("请输入要相乘数字的个数："))
        print(chen((num3)))
    elif n == 4:
        num4 = int(input("请输入被除数："))
        num5 = int (input("请输入除数："))
        if num5 == 0:
            print("除数不能为0")
            break;
        else:
            print(chu(num4,num5))
    else:
        exit()